
export function _debounce(fn, delay) {
    var delay = delay || 200;
    var timer;
    return function () {
        var th = this;
        var args = arguments;
        if (timer) {
            clearTimeout(timer);
        }
        timer = setTimeout(function () {
            timer = null;
            fn.apply(th, args);
        }, delay);
    };
}

export function _throttle(fn,delay){
    let prome = 0
    return function(evet){
        let time = Date.now()
        if(time-prome > delay){
            fn.call(this,evet)
            prome = time
        }
    }
}